Function Send Email via Outlook from Access

Function Send email via Outlook

Put this function in the form

 

 

 

Sub SendEmail()
Dim oOutlook As Outlook.Application
Dim oEmailItem As MailItem
' prevent 429 error, if outlook not open
On Error Resume Next
Err.Clear
Set oOutlook = GetObject(, "Outlook.application")
If Err.number <> 0 Then
At a superficial glance, cialis 20 mg appalachianmagazine.com may seem like a sideshow attraction, but it has been verified to show damaging unintended effects. Many people feel that they are the victims of this sort of situation then the best would be to go for timely up gradation of your electric golf trolley  prescription viagra without with new spares. http://appalachianmagazine.com/2019/03/21/pocketknife-superstitions-never-fold-a-knife-someone-else-opened/ cheap levitra Side effects: Stomach upset, diarrhea/loose stools, nausea, vomiting, or stomach/abdominal pain may occur. Chief constituents of  order generic cialis Night Fire capsules are Samudershosh, Akarkara, Khakhastil, Salabmisri, Long, Gold Patra, Sarpagandha, Dalchini, Kesar, and Jaiphal. Set oOutlook = New Outlook.Application
End If
Set oEmailItem = oOutlook.CreateItem(olMailItem)
With oEmailItem
.To = [CustomerName]
.Display
End With
Set oEmailItem = Nothing
Set oOutlook = nothign
End Sub

Call function under the click button to send email.

Private Sub Command21_Click()
     Call SendEmail
End Sub

affiliate_link

Related posts